<html>
  <head>
    <title>TIScript - Date object</title>
    <meta name="generator" content="h-smile:richtext"/>
  </head>
<body>
  <h1>Color object</h1>
  <p>Just a color.</p>
  <div align="left">
    <table border="0" cellpadding="4" cellspacing="0" width="100%">
      <tr>
        <td colspan="2">Color values are constructed by the <em>global</em> function color():</td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>color</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">(<strong>r</strong>: int, <strong>g</strong>: int, <strong>b</strong>: int [, <strong>opacity</strong>: int | float]) : color
          <p>The <em>color</em> function constructs color value from red, green, blue and opacity components.</p></td></tr>
      <tr>
        <td colspan="2">
          <h2>Constants</h2></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"></td>
        <td bgcolor="#fffff0" valign="middle"><strong>N/A</strong></td></tr>
      <tr>
        <td colspan="2">
          <h2>Properties</h2></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>r</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">read-only, <em>integer</em> 0..255, red channel.</td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>g</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">read-only, <em>integer</em> 0..255, green channel.</td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>b</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">read-only, <em>integer</em> 0..255, blue channel.</td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>a</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">read-only, <em>integer</em> 0..255, alpha value.</td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>opacity</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">read-only, <em>float</em> 0.0 .. 1.0, that is alpha value expressed as a float.</td></tr>
      <tr>
        <td colspan="2" valign="top">
          <h2>Methods</h2></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>rgba</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>(<strong>r</strong>: int, <strong>g</strong>: int, <strong>b</strong>: int [, <strong>opacity</strong>: int | float]) : color</p>
          <p>Static method (of the class), &nbsp;constructs color value from red, green, blue and opacity components.</p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>hsv</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>(<strong>hue</strong>: float, <strong>saturation</strong>: float, <strong>value</strong>: float [, <strong>opacity</strong>: int | float]) : color</p>
          <p>Static method (of the class), &nbsp;constructs the color from HSV values, see: <a href="http://en.wikipedia.org/wiki/HSL_color_space">http://en.wikipedia.org/wiki/HSL_color_space</a></p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><em><strong>hsl</strong></em></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>(<strong>hue</strong>: float, <strong>saturation</strong>: float, <strong>lightness</strong>: float [, <strong>opacity</strong>: int | float]) : color</p>
          <p>Static method (of the class), &nbsp;constructs the color from HSL values, see: <a href="http://en.wikipedia.org/wiki/HSL_color_space">http://en.wikipedia.org/wiki/HSL_color_space</a></p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>tint</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( <strong>luminance</strong>: float [, <strong>saturation</strong>: float] ) : color</p>
          <p>Returns color - tint of the color this method is applied to. luminance and saturation are float numbers in the range -1.0 ... +1.0.</p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>parse</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( <strong>text</strong>: string )</p>
          <p>Static method (of the class), &nbsp;parses the string and constructs the color value. Supported formats:</p>
          <ul>
            <li>&quot;#RGB&quot;</li>
            <li>&quot;#RRGGBB&quot;</li>
            <li>&quot;rgb(r,g,b)&quot;</li>
            <li>&quot;rgba(r,g,b,a)&quot;</li>
            <li>literal color names like: &quot;yellow&quot;, &quot;gold&quot;, &quot;red&quot;, etc.</li></ul></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>toString</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( [#RGB | #rgb | #rgba] ) : string</p>
          <p>Returns string representation of the color value according to the format provided by the symbol defining one of formats:</p>
          <ul>
            <li><em>#RGB</em> - outputs color as &quot;#RRGGBB&quot;;</li>
            <li><em>#rgb</em> - outputs color as &quot;rgb(r,g,b)&quot; string;</li>
            <li><em>#rgba</em> - as &quot;rgba(r,g,b,a)&quot; string.</li></ul></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>toInteger</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( ) : int</p>
          <p>Converts the color to 32bit integer.</p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>toHSV</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( ) : float,float,float</p>
          <p>Returns three values - H,S, and V color components .</p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>toHSL</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( ) : float,float,float</p>
          <p>Returns three values - H,S, and L color components .</p></td></tr></table></div>
</body>
</html>